package lily.phs.urh;


import java.util.Calendar;

import lily.phs.child.ChildList;
import lily.phs.child.ImageList;
import lily.phs.database.Constants;
import lily.phs.diabet.DiabeterList;
import lily.phs.mental.MentalerList;
import lily.phs.object.HealthTest;
import lily.phs.object.HereTipa;
import lily.phs.object.HospitalHistory;
import lily.phs.object.HuiZhenRecord;
import lily.phs.object.JieZhenRecord;
import lily.phs.object.MedicateRecord;
import lily.phs.object.ModuleSelect;
import lily.phs.object.NonimmuneVaccineHistory;
import lily.phs.object.PersonInfo;
import lily.phs.object.SickbedHistory;
import lily.phs.pregnance.PregnantList;
import lily.phs.urh.R;
import lily.phs.vaccination.VaccinationActivity;
import lily.phs.entertain.YuleActivity;
import lily.phs.epidemic.EpidemicList;
import lily.phs.healthedu.HealthMain;
import lily.ui.control.MyArrayAdapter;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

public class MainActivity extends Activity implements OnClickListener,Constants{
	/** Called when the activity is first created. */
	
	private Button leftBtn,rightBtn,rightBtn2;
	private TextView tvDate;;
	private ListView lvInstructs;

	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.main_layout);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.i_title);
		
        leftBtn = (Button) findViewById(R.id.title_left_btn);
        rightBtn = (Button) findViewById(R.id.title_right_btn);
        rightBtn2 = (Button) findViewById(R.id.title_right_btn2);
        leftBtn.setText("退出");
        leftBtn.setOnClickListener(this);
        rightBtn.setVisibility(View.GONE);
        rightBtn2.setVisibility(View.GONE);
        
        
        tvDate = (TextView)this.findViewById(R.id.front_page_date);
        initialDate();
        
        lvInstructs = (ListView)this.findViewById(R.id.front_page_list);
        initialList();

		GridView gv = (GridView) findViewById(R.id.gride);
		final int[] image = { 
				R.drawable.peoplehealth,
				R.drawable.health_education ,
				R.drawable.yiqingshangbao,
				R.drawable.yufangjiezhong,
				R.drawable.entertain,
				R.drawable.childguanli,
				R.drawable.yunfuguanli,
				R.drawable.mental_ill,
				R.drawable.diabet};
		final String[] name = getResources().getStringArray(R.array.modules);
		ImageList adapter = new ImageList(this, image, name);
		gv.setAdapter(adapter);

		gv.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				Intent in;
				switch (arg2) {
				case 0://健康档案管理
					in=new Intent(MainActivity.this,ShelfActivity.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 1://健康教育
					in=new Intent(MainActivity.this,HealthMain.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 2://疫情上报
					in=new Intent(MainActivity.this,EpidemicList.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 3://预防接种
					in=new Intent(MainActivity.this,VaccinationActivity.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 4://寓教于乐
					in=new Intent(MainActivity.this,YuleActivity.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 5://儿童管理
					in=new Intent(MainActivity.this,ChildList.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 6://孕妇管理
					in=new Intent(MainActivity.this,PregnantList.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 7://精神病管理
					in=new Intent(MainActivity.this,MentalerList.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				case 8://糖尿病管理
					in=new Intent(MainActivity.this,DiabeterList.class);
					startActivity(in);
					overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left);
					break;
				default:
					break;
				}
			}

		});
//		insertData();
	}
	
	private void initialList() {
		// TODO Auto-generated method stub
		String[] items = new String[]{
				"国家基本公共卫生服务规范（2011年）",
				"1.城乡居民健康档案管理服务规范",
				"2.健康教育服务规范",
				"3.预防接种服务规范",
				"4.0-6岁儿童健康管理服务规范",
				"5.孕产妇健康管理服务规范",
				"6.老年人健康管理服务规范",
				"7.高血压患者健康管理服务规范",
				"8.2型糖尿病患者健康管理服务规范",
				"9.重性精神疾病患者管理服务规范",
				"10.传染病及突发公共卫生事件报告和处理服务规范",
				"11.卫生监督协管服务规范",};
		
		
//		MyArrayAdapter adapter = new MyArrayAdapter(MainActivity.this, items);
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this,android.R.layout.simple_list_item_1,items);
		lvInstructs.setDivider(null);
		
		lvInstructs.setAdapter(adapter);
	}

	private void initialDate() {
		// TODO Auto-generated method stub
        Calendar c = Calendar.getInstance();
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int day = c.get(Calendar.DAY_OF_MONTH);
        tvDate.setText(year+"年"+month+"月"+day+"日");
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		initialDate();
		super.onResume();
	}

	@Override
	public void finish(){
		super.finish();
		overridePendingTransition(R.anim.anim_slide_in_left,R.anim.anim_slide_out_right);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if(v==leftBtn){
			new AlertDialog.Builder(this)
			.setMessage("确定退出本系统吗？")
			.setPositiveButton("确定", new DialogInterface.OnClickListener() {
				
				@Override
				public void onClick(DialogInterface dialog, int which) {
					// TODO Auto-generated method stub
					finish();
				}
			})
			.setNegativeButton("取消", new DialogInterface.OnClickListener() {
				
				@Override
				public void onClick(DialogInterface dialog, int which) {
					// TODO Auto-generated method stub
					
				}
			})
			.create().show();
		}
	}
	
	public void insertData(){
		Cursor cursor = getBaseContext().getContentResolver().query(CONTENT_URI_TB1, null,
				HETI_PROFILEID + "=" + 111111 + "", null, null);
		if(cursor.getCount()==0){
			//第一个人
			HereTipa ht=new HereTipa(getBaseContext());
			ht.setHeti_profileid(111111);
			ht.setHeti_buil_date("2011-06-01");
			ht.setHeti_name("苏礼珍");
			ht.setHeti_here_id("620122200209000501");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡红柳村152号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡红柳村152号");
			ht.setHeti_tel("5792148");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("红柳村村委会");
			ht.setHeti_buil_per("魏秀芳");
			ht.setHeti_doctor("魏秀芳");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111111);
			pi.setPein_sex(1);
			pi.setPein_born("1961-02-06");
			pi.setPein_perid("620122610206061");
			pi.setPein_phone("5792148");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			pi.setPein_occupation(5);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_live_water(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_toilet(4);
			pi.insertPersonInfo();
			
			createProfiles(111111);
			
			//第二个人
			//HereTipa ht=new HereTipa(getBaseContext());
			ht.setHeti_profileid(111112);
			ht.setHeti_buil_date("2011-06-01");
			ht.setHeti_name("苏义江");
			ht.setHeti_here_id("620122200209000502");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡红柳村152号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡红柳村152号");
			ht.setHeti_tel("5792148");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("红柳村村委会");
			ht.setHeti_buil_per("魏秀芳");
			ht.setHeti_doctor("魏秀芳");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111112);
			pi.setPein_sex(1);
			pi.setPein_born("1936-11-07");
			pi.setPein_perid("620122361107061");
			pi.setPein_phone("5792148");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_marriage(4);
			pi.setPein_hos_cost_type("3");
			pi.setPein_occupation(5);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_live_water(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_toilet(4);
			pi.insertPersonInfo();
			
			createProfiles(111112);
			
			//第三个人
			ht.setHeti_profileid(111113);
			ht.setHeti_buil_date("2011-06-01");
			ht.setHeti_name("罗翠莲");
			ht.setHeti_here_id("620122200209000503");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡红柳村152号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡红柳村152号");
			ht.setHeti_tel("5792148");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("红柳村村委会");
			ht.setHeti_buil_per("魏秀芳");
			ht.setHeti_doctor("魏秀芳");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111113);
			pi.setPein_sex(2);
			pi.setPein_born("1964-02-23");
			pi.setPein_perid("620122640223062");
			pi.setPein_phone("5792148");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			pi.setPein_occupation(5);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_live_water(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_toilet(4);
			pi.insertPersonInfo();
			
			createProfiles(111113);
			
			//第四个人
			ht.setHeti_profileid(111114);
			ht.setHeti_buil_date("2011-04-06");
			ht.setHeti_name("王臣发");
			ht.setHeti_here_id("620122200209000601");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡中窑村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡中窑村");
			ht.setHeti_tel("15002562820");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("中窑村村委会");
			ht.setHeti_buil_per("王著强");
			ht.setHeti_doctor("王著强");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111114);
			pi.setPein_sex(1);
			pi.setPein_born("1972-05-28");
			pi.setPein_perid("620122197205280618");
			pi.setPein_phone("15002562820");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			pi.setPein_drug_allergy("5");
			pi.setPein_drug_allergy_ot("香菜过敏");
			pi.setPein_occupation(5);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(1);
			pi.setPein_live_water(6);
			pi.setPein_live_fuel(1);
			pi.setPein_live_toilet(5);
			pi.insertPersonInfo();
			
			createProfiles(111114);
			
			//第五个人
			ht.setHeti_profileid(111115);
			ht.setHeti_buil_date("2011-04-06");
			ht.setHeti_name("王慧");
			ht.setHeti_here_id("620122200209000602");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡中窑村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡中窑村");
			ht.setHeti_tel("15002562820");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("中窑村村委会");
			ht.setHeti_buil_per("王著强");
			ht.setHeti_doctor("王著强");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111115);
			pi.setPein_sex(2);
			pi.setPein_born("2000-10-17");
			pi.setPein_perid("620122200010170624");
			pi.setPein_phone("15002562820");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			
			pi.setPein_occupation(8);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(1);
			pi.setPein_live_water(6);
			pi.setPein_live_fuel(1);
			pi.setPein_live_toilet(5);
			pi.insertPersonInfo();
			
			createProfiles(111115);
			
			//第六个人
			ht.setHeti_profileid(111116);
			ht.setHeti_buil_date("2011-04-06");
			ht.setHeti_name("王楠");
			ht.setHeti_here_id("620122200209000603");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡中窑村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡中窑村");
			ht.setHeti_tel("15002562820");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("中窑村村委会");
			ht.setHeti_buil_per("王著强");
			ht.setHeti_doctor("王著强");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111116);
			pi.setPein_sex(2);
			pi.setPein_born("2002-08-13");
			pi.setPein_perid("620122200010170624");
			pi.setPein_phone("15002562820");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			
			pi.setPein_occupation(8);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(1);
			pi.setPein_live_water(6);
			pi.setPein_live_fuel(1);
			pi.setPein_live_toilet(5);
			pi.insertPersonInfo();
			
			createProfiles(111116);
			
			//第七个人
			ht.setHeti_profileid(111117);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("梁通中");
			ht.setHeti_here_id("620122200209000401");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_tel("15293153216");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111117);
			pi.setPein_sex(1);
			pi.setPein_born("1963-12-30");
			pi.setPein_perid("620122196312300616");
			pi.setPein_phone("15293153216");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			
			pi.setPein_occupation(8);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_water(3);
			pi.setPein_live_fuel(2);
			pi.setPein_live_toilet(5);
			pi.insertPersonInfo();
			
			createProfiles(111117);
			
			//第八个人
			ht.setHeti_profileid(111118);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("彭正连");
			ht.setHeti_here_id("620122200209000402");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_tel("15293153216");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111118);
			pi.setPein_sex(2);
			pi.setPein_born("1969-03-27");
			pi.setPein_perid("620122196312300616");
			pi.setPein_phone("15293153216");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			
			pi.setPein_occupation(8);
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_water(3);
			pi.setPein_live_fuel(2);
			pi.setPein_live_toilet(5);
			pi.insertPersonInfo();
			
			createProfiles(111118);
			
			//第九个人
			ht.setHeti_profileid(111119);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("邓长生");
			ht.setHeti_here_id("620122570410061");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村36号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村36号");
			ht.setHeti_tel("13669387137");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111119);
			
			pi.setPein_sex(1);
			pi.setPein_born("1957-04-10");
			pi.setPein_perid("620122570410061");
			pi.setPein_phone("13669387137");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_occupation(5);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			pi.setPein_disease("13");
			pi.setPein_disease_ot("胸腔积液");
			pi.setPein_disease_date("13-2009-04");
			pi.setPein_trauma(2);
			pi.setPein_trauma_name1("肋骨骨折");
			pi.setPein_trauma_time1("2008-02-04");
			pi.setPein_transfusion(1);
			pi.setPein_family_his_sd("2");
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111119);
			
			//第十个人
			ht.setHeti_profileid(111120);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("马才梅");
			ht.setHeti_here_id("620122621108062");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村36号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村36号");
			ht.setHeti_tel("13669387137");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111120);
			
			pi.setPein_sex(2);
			pi.setPein_born("1962-11-08");
			pi.setPein_perid("620122621108062");
			pi.setPein_phone("13669387137");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_occupation(5);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_family_his_ft("5");
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111120);
			
			//第十一个人
			ht.setHeti_profileid(111121);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("邓玉军");
			ht.setHeti_here_id("620122890717061");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村36号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村36号");
			ht.setHeti_tel("13669387137");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111121);
			
			pi.setPein_sex(1);
			pi.setPein_born("1989-07-17");
			pi.setPein_perid("620122890717061");
			pi.setPein_phone("13669387137");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_occupation(5);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_family_his_mt("2");
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111121);
			
			//第十二个人
			ht.setHeti_profileid(111122);
			ht.setHeti_buil_date("2011-04-07");
			ht.setHeti_name("杨含芳");
			ht.setHeti_here_id("62012219460505062");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡中窑村80号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡中窑村80号");
			ht.setHeti_tel("5794333");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("余建红");
			ht.setHeti_doctor("余建红");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111122);
			
			pi.setPein_sex(2);
			pi.setPein_born("1946-05-05");
			pi.setPein_perid("62012219460505062");
			pi.setPein_phone("5794333");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_occupation(5);
			pi.setPein_marriage(3);
			pi.setPein_hos_cost_type("3");
			pi.setPein_disease("2,3,13");
			pi.setPein_disease_ot("慢性胆囊炎");
			pi.setPein_disease_date("02-2008-04,03-2008-07,13-2010-06");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_family_his_bs("2");
			
			pi.setPein_hereditary_his(1);
			pi.setPein_live_kit(1);
			pi.setPein_live_fuel(5);
			pi.setPein_live_water(6);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111122);
			
			//第十三个人
			ht.setHeti_profileid(111123);
			ht.setHeti_buil_date("2011-04-07");
			ht.setHeti_name("王继先");
			ht.setHeti_here_id("62012219740120065");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡中窑村80号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石中窑村80号");
			ht.setHeti_tel("5794333");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("余建红");
			ht.setHeti_doctor("余建红");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111123);
			
			pi.setPein_sex(1);
			pi.setPein_born("1974-01-20");
			pi.setPein_perid("62012219740120065");
			pi.setPein_phone("5794333");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(4);
			pi.setPein_occupation(5);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("8");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_family_his_mt("2,3,12");
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111123);
			
			//第十四个人
			ht.setHeti_profileid(111124);
			ht.setHeti_buil_date("2011-04-07");
			ht.setHeti_name("王亮忠");
			ht.setHeti_here_id("62012219740415063");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡中窑村80号");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡中窑村80号");
			ht.setHeti_tel("5794333");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("余建红");
			ht.setHeti_doctor("余建红");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111124);
			
			pi.setPein_sex(1);
			pi.setPein_born("1974-04-15");
			pi.setPein_perid("62012219740415063");
			pi.setPein_phone("5794333");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_occupation(5);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			pi.setPein_family_his_mt("2,3,11");
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111124);
			
			//第十五个人
			ht.setHeti_profileid(111125);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("孙效兵");
			ht.setHeti_here_id("620122580712061");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_tel("15193104321");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111125);
			
			pi.setPein_sex(1);
			pi.setPein_born("1958-07-12");
			pi.setPein_perid("620122580712061");
			pi.setPein_phone("15193104321");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(2);
			pi.setPein_occupation(5);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111125);
			
			//第十六个人
			ht.setHeti_profileid(111126);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("马艳翠");
			ht.setHeti_here_id("620122620917062");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_tel("15193104321");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111126);
			
			pi.setPein_sex(1);
			pi.setPein_born("1962-09-17");
			pi.setPein_perid("620122620917062");
			pi.setPein_phone("15193104321");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_occupation(5);
			pi.setPein_marriage(2);
			pi.setPein_hos_cost_type("3");
			pi.setPein_disease("13");
			pi.setPein_disease_ot("乳腺炎");
			pi.setPein_disease_date("13-2011-03");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111126);
			
			//第十七个人
			ht.setHeti_profileid(111127);
			ht.setHeti_buil_date("2011-03-18");
			ht.setHeti_name("孙福明");
			ht.setHeti_here_id("620122830918065");
			ht.setHeti_now_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_hore_addr("甘肃省兰州市皋兰县黑石乡石青村");
			ht.setHeti_tel("15193104321");
			ht.setHeti_town_name("甘肃省兰州市皋兰县黑石乡");
			ht.setHeti_vico_name("石青村村委会");
			ht.setHeti_buil_per("郑晓祥");
			ht.setHeti_doctor("郑晓祥");
			ht.setHeti_buil_unit("黑卫");
			ht.insertHereTipa();
			
			//PersonInfo pi=new PersonInfo(getBaseContext());
			pi.setPein_profile_id(111127);
			
			pi.setPein_sex(1);
			pi.setPein_born("1983-09-18");
			pi.setPein_perid("620122830918065");
			pi.setPein_phone("15193104321");
			pi.setPein_nation(1);
			pi.setPein_culture_stdd(3);
			pi.setPein_occupation(5);
			pi.setPein_marriage(1);
			pi.setPein_hos_cost_type("3");
			pi.setPein_surgery(1);
			pi.setPein_trauma(1);
			pi.setPein_transfusion(1);
			
			pi.setPein_hereditary_his(1);
			pi.setPein_disable_situ("1");
			pi.setPein_live_kit(4);
			pi.setPein_live_fuel(2);
			pi.setPein_live_water(4);
			pi.setPein_live_toilet(5);
			pi.setPein_live_stock(1);
			pi.insertPersonInfo();
			
			createProfiles(111127);
			
		}
	}
	
	public void createProfiles(int pro){
		
		//体检表
		HealthTest htt=new HealthTest(getBaseContext());
		htt.setHete_profileid(pro);
		htt.setHete_testid(1);//第一次体检???
		htt.insertHealthTest();
		
		//住院史---限填2项
		HospitalHistory hh = new HospitalHistory(getBaseContext());
		hh.setHohi_profileid(pro);
		hh.setHohi_testid(1);
		hh.setHohi_id(1);
		hh.insertHospitalHistory();
		hh.setHohi_profileid(pro);
		hh.setHohi_testid(1);
		hh.setHohi_id(2);
		hh.insertHospitalHistory();
		//病床史---限填2项
		SickbedHistory sh = new SickbedHistory(getBaseContext());
		sh.setSihi_profileid(pro);
		sh.setSihi_testid(1);
		sh.setSihi_id(1);
		sh.insertSickbedHistory();
		sh.setSihi_profileid(pro);
		sh.setSihi_testid(1);
		sh.setSihi_id(2);
		sh.insertSickbedHistory();
		//吃药信息---限填6项
		MedicateRecord mr = new MedicateRecord(getBaseContext());
		mr.setMere_profileid(pro);
		mr.setMere_testid(1);
		mr.setMere_id(1);
		mr.insertMedicateRecord();
		mr.setMere_profileid(pro);
		mr.setMere_testid(1);
		mr.setMere_id(2);
		mr.insertMedicateRecord();
		mr.setMere_profileid(pro);
		mr.setMere_testid(1);
		mr.setMere_id(3);
		mr.insertMedicateRecord();
		mr.setMere_profileid(pro);
		mr.setMere_testid(1);
		mr.setMere_id(4);
		mr.insertMedicateRecord();
		mr.setMere_profileid(pro);
		mr.setMere_testid(1);
		mr.setMere_id(5);
		mr.insertMedicateRecord();
		mr.setMere_profileid(pro);
		mr.setMere_testid(1);
		mr.setMere_id(6);
		mr.insertMedicateRecord();
		//非免疫预防接种---限填3项
		NonimmuneVaccineHistory nvh = new NonimmuneVaccineHistory(getBaseContext());
		nvh.setNovh_profileid(pro);
		nvh.setNovh_testid(1);
		nvh.setNovh_id(1);
		nvh.insertNonimmuneVaccineHistory();
		nvh.setNovh_profileid(pro);
		nvh.setNovh_testid(1);
		nvh.setNovh_id(2);
		nvh.insertNonimmuneVaccineHistory();
		nvh.setNovh_profileid(pro);
		nvh.setNovh_testid(1);
		nvh.setNovh_id(3);
		nvh.insertNonimmuneVaccineHistory();
		
		ModuleSelect ms=new ModuleSelect(getBaseContext());
		ms.setMose_profile_id(pro);
		ms.setMose_health_record_id(1);
		ms.insertModuleSelect();
		JieZhenRecord jzr=new JieZhenRecord(getBaseContext());
		jzr.setThre_profileid(pro);
		jzr.setThre_state(1);
		jzr.insertJieZhenRecord();
		HuiZhenRecord hzr=new HuiZhenRecord(getBaseContext());
		hzr.setCore_profileid(pro);
		hzr.setCore_state(1);
		hzr.insertHuiZhenRecord();
		
	}
}